UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5v519OaaER0R+x+jqrxJFvTAOAYVMeA2a1KYBqnfbjU='
WHERE
key_id = '93295e045a6329f400b9acef7be03c76ba537322a846f5f91307226ceb1fe772'
AND (
token = '5v519OaaER0R+x+jqrxJFvTAOAYVMeA2a1KYBqnfbjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)