UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sTx8BfmD9tn+p0dmQiAJo0XMQIgnVAdtp7c1wV4vlo8=' 
WHERE 
  key_id = '9c54b40ea822a1f340d65e9cc659573ac1b7a18c66214aad8032032b81b06d40' 
  AND (
    token = 'sTx8BfmD9tn+p0dmQiAJo0XMQIgnVAdtp7c1wV4vlo8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034