UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IZuBgKwPFaN8xndaYedkUEdvppG7GMm2At9B+O5BwDE='
WHERE
key_id = '75946fc61fdae39247f222fd5a085f8c52e1fe5786a499365a2fc27c58159058'
AND (
token = 'IZuBgKwPFaN8xndaYedkUEdvppG7GMm2At9B+O5BwDE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)