UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rWdbu/MYSh07zmKJCzx0cOlubtRxW7JI5MBcqhmj7UQ=' 
WHERE 
  key_id = 'ccf8f4c3fe6b3857cbed922ff271c5e4c811cfd8b5c88b484b9970436b2c3046' 
  AND (
    token = 'rWdbu/MYSh07zmKJCzx0cOlubtRxW7JI5MBcqhmj7UQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036