UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jMz97MhJkL9sUWKgYcwG3zjR2bB2h7QmlLle2G7m6Sc='
WHERE
key_id = '4691bfd8793bbd6706ced3e2fa1a653fd4c04e6be5095fcb3412d433ec0459a7'
AND (
token = 'jMz97MhJkL9sUWKgYcwG3zjR2bB2h7QmlLle2G7m6Sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)