UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mHqxPE/DBR43a9rNMyvQulH/1YvcNs+DtQALX3X0DMQ='
WHERE
key_id = '9391d0596bdf9439e10e28e71cf343123fe49cef7e0a8cb33df6debebb7ead91'
AND (
token = 'mHqxPE/DBR43a9rNMyvQulH/1YvcNs+DtQALX3X0DMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)