UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '23h4AgYnT7RrgpK4y2YC3YYD4brRuqryIu75C4Aoy1A=' 
WHERE 
  key_id = '129b559de1342551e5dde9f004bb60795a3e0b705f8316678d0cf6fb4bd775a6' 
  AND (
    token = '23h4AgYnT7RrgpK4y2YC3YYD4brRuqryIu75C4Aoy1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022