UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6QXhTZHZ6eZ7+uAbDA4qer5zcN1eif4mXtzUk8WJpY8='
WHERE
key_id = 'f8d7c1e37b40675ac8ae9c0a4b7c99a2d3d825325b1d4fe556f9a69771a177d4'
AND (
token = '6QXhTZHZ6eZ7+uAbDA4qer5zcN1eif4mXtzUk8WJpY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)