UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZbHDF2QPfB2CIYSNuS0TsnOAKGqKKcSyJ829i6pd9YE='
WHERE
key_id = 'be79c2a4397307b87e2cdd54d2dbefccf3a98c622223bc09544163af5ac598c1'
AND (
token = 'ZbHDF2QPfB2CIYSNuS0TsnOAKGqKKcSyJ829i6pd9YE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)