UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wa5IKkjbwMVi9YDZrhMj8g3TWPQRmGXZmHnT3IQF5+0='
WHERE
key_id = '1e94e6f47812ad475da5d75c1c5166398e12de39d2729d4d5a042078d890448b'
AND (
token = 'wa5IKkjbwMVi9YDZrhMj8g3TWPQRmGXZmHnT3IQF5+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)