UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ToF+HCZRXB4essMOVA732qkKTgo7k/fjQxCbvSzdt0I='
WHERE
key_id = 'e3d82c2395c13b49ade529f7fcab01e15f3ae1b798effa0685cdb5ff9fb9870e'
AND (
token = 'ToF+HCZRXB4essMOVA732qkKTgo7k/fjQxCbvSzdt0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)