UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rCmqbRf678mIoU/yVZjc21qI2CPhTZc8HEaJZk6m3gA=' 
WHERE 
  key_id = '859549191d64722c058d86dda08cec6c55f5959b4f26176b82c040b0de7402fc' 
  AND (
    token = 'rCmqbRf678mIoU/yVZjc21qI2CPhTZc8HEaJZk6m3gA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037