UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zhlKko+PBULkisLz4hPlARhqHjk7+/Kk9h9vF4Cawc0=' 
WHERE 
  key_id = '84d7a725716d3d1c7c6dd71be1f6bca794746a7eb3f461abca50285733d7723b' 
  AND (
    token = 'zhlKko+PBULkisLz4hPlARhqHjk7+/Kk9h9vF4Cawc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034