UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WTJ+In1qR4/L0SxYvLWUAwTRbemRL47NXKEdFXaYWDY=' 
WHERE 
  key_id = '33fb334852f76952dfbd4987a10d45c939490ea7c4ce4a9e0dbd7d75386c7350' 
  AND (
    token = 'WTJ+In1qR4/L0SxYvLWUAwTRbemRL47NXKEdFXaYWDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026