UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3MxcWYr1n5y4H6YMnZ5YDdJ6ZwFNYHObarIWXKAVP78='
WHERE
key_id = '763a4b695fc7d2a587935e7f6af06e2a2a600f57846ea8b17cdbaee9df3c729f'
AND (
token = '3MxcWYr1n5y4H6YMnZ5YDdJ6ZwFNYHObarIWXKAVP78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)