UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jDXuG64la+zvJZjdXJTlT+5lEdXgx1QNALqxg990BwE='
WHERE
key_id = 'a69bbe6121765ac8ef389e59c1209cb51c0ffaa350ff7882f1a8d13ef48c1eb8'
AND (
token = 'jDXuG64la+zvJZjdXJTlT+5lEdXgx1QNALqxg990BwE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)