UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/TxwiuWhakO+wFNSi4QG5s1Hb3H891qD0BfEZUQxFn0='
WHERE
key_id = '219ae086b2be801de0c56a16b1218126177c2a6061f46d00001a1340fce6083b'
AND (
token = '/TxwiuWhakO+wFNSi4QG5s1Hb3H891qD0BfEZUQxFn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)