UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0uGzyPEn3W++bBeT8jUGeRA36/ceF0V/58WJ2c4y8e8=' 
WHERE 
  key_id = '7a96264c66b785764de8d132d0da53e5ded7e23ec7096a36c5b1ae98417be51a' 
  AND (
    token = '0uGzyPEn3W++bBeT8jUGeRA36/ceF0V/58WJ2c4y8e8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024