UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hnxPIgRHO+AZiyz9yVwitR/bfj1V/lwu+JmU6kGv0R0=' 
WHERE 
  key_id = '3110dd1375c6373e3f51ff521996207a4c81d3a4ca1b79fd8081bfdc91ab0e3f' 
  AND (
    token = 'hnxPIgRHO+AZiyz9yVwitR/bfj1V/lwu+JmU6kGv0R0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021