UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dv8yJJqtCahJdzlGQ6DSCRofeDyQHvAJG29m3aOyY0I='
WHERE
key_id = '9055978118fd31a05d32d607f5510918f6eb42d65a226749f8289f296c30d113'
AND (
token = 'Dv8yJJqtCahJdzlGQ6DSCRofeDyQHvAJG29m3aOyY0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)