UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'svc5hroT9iaKQu2BXtEG35Q3+l58Bm2tFyP9lnH/vAg=' 
WHERE 
  key_id = 'b53b8463e0b7fffd2562ad1b4c9a06e77ff2113d9a67d82b58ed7b55815e851b' 
  AND (
    token = 'svc5hroT9iaKQu2BXtEG35Q3+l58Bm2tFyP9lnH/vAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037