UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AdZmwLOoALOzZNs+15GA1u+EsfAXjlgFGsMQf07qEBc='
WHERE
key_id = 'ccb026aa59708cc8b55915dcc6c8ef9b3e772b3f5bd11a5cb6a7b0978043119d'
AND (
token = 'AdZmwLOoALOzZNs+15GA1u+EsfAXjlgFGsMQf07qEBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)