UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dftk0Oi81tuGvGtYnl1BKQ7pFeiCrLdBOsME3bJEd6k='
WHERE
key_id = '404473f63e905be215e6aecd166a7ebabbde93630e74311aba3c90dde525f19c'
AND (
token = 'dftk0Oi81tuGvGtYnl1BKQ7pFeiCrLdBOsME3bJEd6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)