UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xtk1rNyXNXEAOh4nd924VRWHCLAYRYQTQalWvZD3RwU=' 
WHERE 
  key_id = '8ef38f5d78f8ddb1001356ee7822754a0f234202e5fd7ad5c9fa6263969d2ccc' 
  AND (
    token = 'xtk1rNyXNXEAOh4nd924VRWHCLAYRYQTQalWvZD3RwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062