UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OE9v1KzM50LbOjp2/qngh/nhzkil0q2z+qMbUBzOLB0=' 
WHERE 
  key_id = '962508721ac6c8922ba03dbd8510bff1c9edcda6f9106783e349c0c14a3fd8bc' 
  AND (
    token = 'OE9v1KzM50LbOjp2/qngh/nhzkil0q2z+qMbUBzOLB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023