UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jqzGyQsvPpM/0FAR+3Lle0m3WcUl4xAcPC6DRbh4uN0=' 
WHERE 
  key_id = 'b56e7fb1617aa51673d672bd9e6ebe90b858b89d02caac712e6cc5b01702a395' 
  AND (
    token = 'jqzGyQsvPpM/0FAR+3Lle0m3WcUl4xAcPC6DRbh4uN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00244