UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+2F+NGgFBETz2IAJim/bPbDF4/cG3OYFA2hOtiPKueA=' 
WHERE 
  key_id = '176f317dc3eb295a196bebd8f29b6d7cb0c3f1c57bb6e36c1fafcaede0b8b292' 
  AND (
    token = '+2F+NGgFBETz2IAJim/bPbDF4/cG3OYFA2hOtiPKueA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037