UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pzvmVztfamk3+01PG3gYpQ4X32cQZKzLtn2654ZtRCg=' 
WHERE 
  key_id = 'b9d596ad7c239c18e9ac4170f8816e45dfb795a48df4a665376ce5fbb51d46b5' 
  AND (
    token = 'pzvmVztfamk3+01PG3gYpQ4X32cQZKzLtn2654ZtRCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036