UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9fJLwPFD4jSmSDZ2mIzQm1GP7T7Os7GHCLqldTgsF5w='
WHERE
key_id = '212d05fd10975ee41ede7426e0f7fed86be1587627a8a2798b7298d8365a5f3b'
AND (
token = '9fJLwPFD4jSmSDZ2mIzQm1GP7T7Os7GHCLqldTgsF5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)