UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I2ukDq4ZaO7IibZxjP0DOj/weUlGyfxsIRKMuM0GHsA='
WHERE
key_id = 'e44fadbb6092a0241e8fd5cc34deb3bc5d232288aded6e3b9dc08d26451bfb0a'
AND (
token = 'I2ukDq4ZaO7IibZxjP0DOj/weUlGyfxsIRKMuM0GHsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)