UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tkXT7OLfC92Tj4Q8APh2vF2lmOEA9k/yk564oPnBo+8='
WHERE
key_id = '9e20a8c68c1a7bf0c0aa4310dfe7f9ee08f552d6cc981c64dc0a0fbefb327c19'
AND (
token = 'tkXT7OLfC92Tj4Q8APh2vF2lmOEA9k/yk564oPnBo+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)