UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KvlFcj5ZnW3S9A4HxdwPdPAPVBLW/xenbrayZuwWri0='
WHERE
key_id = 'a2df2dc7e156b09b6276dc71642b12717a6c00178961dde52ff131bb8c4cc104'
AND (
token = 'KvlFcj5ZnW3S9A4HxdwPdPAPVBLW/xenbrayZuwWri0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)