UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '53LQ2YbOZILegyO1E8F3HfpibukGL4np38H+gyrvfxA='
WHERE
key_id = '6d46d160cfc655447fb9f671a5d35859f9091d0d3165bb7fa0713257efc97a79'
AND (
token = '53LQ2YbOZILegyO1E8F3HfpibukGL4np38H+gyrvfxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)