UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'duee7Fm2Dquur+nB1t6/Selb9ZDhdZsT3l10qNjzgXY='
WHERE
key_id = '220b2dc01f7cf20b8a0b800a87e4fc62d734de43940255118a95c30f0ff46036'
AND (
token = 'duee7Fm2Dquur+nB1t6/Selb9ZDhdZsT3l10qNjzgXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)