UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H62Vg/g8lQPDPQb1N4lnxFpzYd0X1AvGiyugehidzDg=' 
WHERE 
  key_id = '8d6b78f8391122c57ad2e100fe7e3a2d63a72db6fb59eed60bb1fc793b032dbd' 
  AND (
    token = 'H62Vg/g8lQPDPQb1N4lnxFpzYd0X1AvGiyugehidzDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033