UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I8I1QlQnu8qRx5Y1/z3d3PcLYUzH/e4qA53dzK5rIeI=' 
WHERE 
  key_id = '2bbaf553c3c8f3cde83fc6a17f6769d55c0c6e673cde7fbf4e472b024c16a750' 
  AND (
    token = 'I8I1QlQnu8qRx5Y1/z3d3PcLYUzH/e4qA53dzK5rIeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025