UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Alrpxbgvq0BnrFFCjYZXdaP3OwRIoVe1EFGAfFd2cks=' 
WHERE 
  key_id = '60b4d37a10e229521c00bf94be4d308491be8a881bdb335fee4d8e487fec78e1' 
  AND (
    token = 'Alrpxbgvq0BnrFFCjYZXdaP3OwRIoVe1EFGAfFd2cks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023