UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uKvVHf20X9mLQkq/HkdnW3nkwsV5SPq17X7XAQJYlLE='
WHERE
key_id = '604673921e3a1d1c7165267b55be4152cd41fd455ff3ce73e31a5585b77cba7b'
AND (
token = 'uKvVHf20X9mLQkq/HkdnW3nkwsV5SPq17X7XAQJYlLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)