UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jZapYjvvAPqZLhErYBYGKsjGZ5/XKo10ZCwbpoZMzWs=' 
WHERE 
  key_id = '7a8a818b1e5968d6aaa5356824708e1dd3e6b6e014661942d511466912d0236d' 
  AND (
    token = 'jZapYjvvAPqZLhErYBYGKsjGZ5/XKo10ZCwbpoZMzWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030