UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eiAh1RfBjGiPdcaieBbcvX6bU6hAhQ837UuO7jrnmIA=' 
WHERE 
  key_id = 'a7c1c149f0292826c69eed2acbc7ba400c1916e3f1d45d034f2d7fb9f4d786e0' 
  AND (
    token = 'eiAh1RfBjGiPdcaieBbcvX6bU6hAhQ837UuO7jrnmIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022