UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HL87byHSdhNGmBeYrmk7zrosdjHlpru2iyPwcGk/kB4=' 
WHERE 
  key_id = '449a1b52532bbdcab27abfb649c4fd3ddb0a869ed97364ed17a6d30f5cdf182f' 
  AND (
    token = 'HL87byHSdhNGmBeYrmk7zrosdjHlpru2iyPwcGk/kB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027