UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C6wVs1A8kIegZY9J2nKMZtBUsy/6W3VUjP61sAYVomk='
WHERE
key_id = '75d6eb7901ad909296f238c0f9ba8ace81800957d48309928cd6a4e7c5bf387a'
AND (
token = 'C6wVs1A8kIegZY9J2nKMZtBUsy/6W3VUjP61sAYVomk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)