UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZsARWmXzqW2l/hnFdILYoQaPemKa44+Qsp0LAafqKcc='
WHERE
key_id = 'd11da2b272bbd75c40fc2c488b5ec514a8a53c5da58e5e3342227937938a32e1'
AND (
token = 'ZsARWmXzqW2l/hnFdILYoQaPemKa44+Qsp0LAafqKcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)