UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lfo0wEtrQPCTL5cCqlbDfFqBmOD0NcoP1cnIcAc33uY=' 
WHERE 
  key_id = '7588abc1831c69d03aaa8c744c239d79dc99ab99840546b2be8f79569cd01cd8' 
  AND (
    token = 'lfo0wEtrQPCTL5cCqlbDfFqBmOD0NcoP1cnIcAc33uY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034