UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IB25C9nRxhJgWQhXbmrjwAFE5UoalnpeVkIWUGprm+c=' 
WHERE 
  key_id = '7475bea7156de3d2b2bbf9c4ed45edb52bda26bc682347b4bbe56bb5fc66b1df' 
  AND (
    token = 'IB25C9nRxhJgWQhXbmrjwAFE5UoalnpeVkIWUGprm+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022