UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mfsoilTeSqZPz9Z5Iol9cco2M7Bcm5CLqGc3igwZ30s=' 
WHERE 
  key_id = 'c374d2bfe97ff841797656c86223a213e5f3f2fda9f6a79cc546d8d66753a192' 
  AND (
    token = 'mfsoilTeSqZPz9Z5Iol9cco2M7Bcm5CLqGc3igwZ30s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042