UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TdOvgQH98MczLOZIoXo0UTxSJBDCblnKNHxQl+0ZV6E=' 
WHERE 
  key_id = '2a60e3542a6eb4a1de3ce755555382f14ffa4de5079380696ff7923d32986e17' 
  AND (
    token = 'TdOvgQH98MczLOZIoXo0UTxSJBDCblnKNHxQl+0ZV6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016