UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oYmzZM1HK4B/FmqteISLpq1YSWzBCkGsOql2y4ibvLk='
WHERE
key_id = '2be98e26793709efc2e23e2485e100895ce5766c5b4bc382f664a6cdf2ab4044'
AND (
token = 'oYmzZM1HK4B/FmqteISLpq1YSWzBCkGsOql2y4ibvLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)