UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NYgyELhXRe0Lin469Ml8E79bHh65K56tP0DqVCsDWts='
WHERE
key_id = '8a1e2cde0f599462fa13862219ae22b6c4a0dd55ef99fc58fa828bf045204cfc'
AND (
token = 'NYgyELhXRe0Lin469Ml8E79bHh65K56tP0DqVCsDWts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)