UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IoJ1ECwwJC20elIVqB3MbPCBV2U4v+Dr2S5aALSFto0='
WHERE
key_id = '73a3a80e95e706fee2f79ca3454ee16f3de75c7ca670e977ccda2765744e3bb0'
AND (
token = 'IoJ1ECwwJC20elIVqB3MbPCBV2U4v+Dr2S5aALSFto0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)