UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wFdYwYS4B3MjtWKZz9NVpAitDUpda/GURWHQxcHeSZA=' 
WHERE 
  key_id = '56efc979737f955cf9541e5fb95d911c283cce7b2d1d442b636f2f770d65e03f' 
  AND (
    token = 'wFdYwYS4B3MjtWKZz9NVpAitDUpda/GURWHQxcHeSZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035