UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VTVNCGmnEeLk9iXrGMeLae1ym9YcQNXifsgr7v27/eo=' 
WHERE 
  key_id = 'fdbf0adad32ee6ffd6fbe5ba9c48cd79f4b0fa4f73d0aa6fe752cfe71cad3786' 
  AND (
    token = 'VTVNCGmnEeLk9iXrGMeLae1ym9YcQNXifsgr7v27/eo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030