UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Fh3BkxRGUjMVgY2faNzBxvcJ9TE+OiNNai6FRS4QKc='
WHERE
key_id = '32d50d3e2ff7f055fbae950aae659f44f34ff0b8142a8eb7e48dcab09a3f12dc'
AND (
token = '+Fh3BkxRGUjMVgY2faNzBxvcJ9TE+OiNNai6FRS4QKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)